<% content_for :title , 'Welcome' %>
<% crumbs %>


<% border 'border3' do %>
  <div id="map-container" >
    <% border 'border4' do %>
      <div id="map-overlay"
           style="display:none;"
           onclick="$(this).update('<img src=\'<%= image_path 'loading.gif'
                    -%>\' id=\'spinner\' />');$(this).hide()" >
             <%= image_tag('loading.gif', :id => 'spinner') -%>
      </div>
      <%= generate_imagemap_for_territories @territories %>
      <%= image_tag 'map/base.jpg', :size => "500x350",
                                :alt => "Territories Map",
                                :usemap => "#map",
                                :border => 0 %>
      <%#*<img alt="Territories Map" usemap="#map" border="0"%>
           <%#*src="<%= url_for :action => 'show', :controller => 'territories' % >.png" />%>
    <% end %>
    <% if current_user and current_user.is_admin? %>
      <%= link_to image_tag('cc_panel_bottom.png', :id => 'map-bottom'), edit_territories_path -%>
    <% else %>
      <%= image_tag 'cc_panel_bottom.png', :id => 'map-bottom' %>
    <% end %>
  </div>
  <div id="news-container">
    <%= link_to('New', {:controller => :news, :action => :new},
                  :popup => ['name="news', 'width=520,height=400,top=150,' +
                                           'left=350,location=0,toolbar=0,status=0']) if current_user and current_user.is_admin? %>
    <% @news.each do |new| %>
      <%= render :partial => 'news/show', :locals => {:new => new} %>
    <% end %>
  </div>
<% end %>